package com.example.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mapper.ProductMapper;
import com.example.model.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductService extends ServiceImpl<ProductMapper, Product> {

    @Autowired
    ProductMapper productMapper;
      public List<Product> proList(Integer id){//这个方法凭借一个种类ID查出一堆商品信息。
             List <Product> products = productMapper.proList(id);
             return products;
      }

      public Integer getPrice(Integer id){
          return this.productMapper.getPrice(id);
      }
}
